# 设置三角形大小
size = 5
# 直角三角形
i = 1
while i <= size:
    j = 1
    while j <= i:
        print("*", end="")
        j += 1
    print()  # 换行
    i += 1

# 倒直角三角形
i = size
while i >= 1:
    j = 1
    while j <= i:
        print("*", end="")
        j += 1
    print()  # 换行
    i -= 1
